// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

import category from '@/views/category/category';
import wikidoc from '@/views/wikidoc/wikidoc';
import rebot from '@/views/rebot/rebot';
import rebotedit from '@/views/rebot/edit';

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
    routes: [{
        path: '/',
        name: 'login',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },

    {
        path: '/login',
        name: 'login',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }

    , {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
          {
            path: '/rebot/rebot',
            name: 'rebot',
            component: rebot,
            meta: {
              requireAuth: true
            }
          },
          {
            path: '/rebot/edit',
            name: 'rebotedit',
            component: rebotedit,
            meta: {
              requireAuth: true
            }
          },
          {
            path: '/wikidoc/wikidoc',
            name: 'wikidoc',
            component: wikidoc,
            meta: {
              requireAuth: true
            }
          },
          {
            path: '/category/category',
            name: 'category',
            component: category,
            meta: {
              requireAuth: true
            }
          },
    ]
    }]
})
